/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2013
 */

package com.bbs.bean;

import javacommon.base.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;

/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "bbs_collect_info")
public class BbsCollectInfo extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "BbsCollectInfo";
	public static final String ALIAS_COLLECT_ID = "收藏的id";
	public static final String ALIAS_COLLECT_TITLEID = "收藏主题id";
	public static final String ALIAS_COLLECT_USERID = "收藏用户id";
	public static final String ALIAS_COLLECT_BLOCKID = "收藏版块id";
	public static final String ALIAS_COLLECT_BLOCKNAME = "收藏版块名称";
	public static final String ALIAS_COLLECT_TITLE = "收藏主题";
	public static final String ALIAS_COLLECT_TITLE_REPLY_NUM = "主题回复数";
	public static final String ALIAS_COLLECT_LAST_REPLY_USERID = "最后回复用户id";
	public static final String ALIAS_COLLECT_LAST_REPLY_USERNAME = "最后回复用户名称";
	public static final String ALIAS_COLLECT_LAST_REPLY_TIME = "最后回复时间";
	
	//date formats
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 收藏的id       db_column: collect_id 
     */ 	
	
	private java.lang.Integer collectId;
    /**
     * 收藏主题id       db_column: collect_titleid 
     */ 	
	
	private java.lang.Integer collectTitleid;
    /**
     * 收藏用户id       db_column: collect_userid 
     */ 	
	
	private java.lang.Integer collectUserid;
    /**
     * 收藏版块id       db_column: collect_blockid 
     */ 	
	
	private java.lang.Integer collectBlockid;
    /**
     * 收藏版块名称       db_column: collect_blockname 
     */ 	
	@Length(max=100)
	private java.lang.String collectBlockname;
    /**
     * 收藏主题       db_column: collect_title 
     */ 	
	@Length(max=100)
	private java.lang.String collectTitle;
    /**
     * 主题回复数       db_column: collect_title_reply_num 
     */ 	
	
	private java.lang.Integer collectTitleReplyNum;
    /**
     * 最后回复用户id       db_column: collect_last_reply_userid 
     */ 	
	
	private java.lang.Integer collectLastReplyUserid;
    /**
     * 最后回复用户名称       db_column: collect_last_reply_username 
     */ 	
	@Length(max=50)
	private java.lang.String collectLastReplyUsername;
    /**
     * 最后回复时间       db_column: collect_last_reply_time 
     */ 	
	@Length(max=20)
	private java.lang.String collectLastReplyTime;
	//columns END


	public BbsCollectInfo(){
	}

	public BbsCollectInfo(
		java.lang.Integer collectId
	){
		this.collectId = collectId;
	}

	

	public void setCollectId(java.lang.Integer value) {
		this.collectId = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "increment")
	@Column(name = "collect_id", unique = true, nullable = false, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getCollectId() {
		return this.collectId;
	}
	
	@Column(name = "collect_titleid", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getCollectTitleid() {
		return this.collectTitleid;
	}
	
	public void setCollectTitleid(java.lang.Integer value) {
		this.collectTitleid = value;
	}
	
	@Column(name = "collect_userid", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getCollectUserid() {
		return this.collectUserid;
	}
	
	public void setCollectUserid(java.lang.Integer value) {
		this.collectUserid = value;
	}
	
	@Column(name = "collect_blockid", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getCollectBlockid() {
		return this.collectBlockid;
	}
	
	public void setCollectBlockid(java.lang.Integer value) {
		this.collectBlockid = value;
	}
	
	@Column(name = "collect_blockname", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public java.lang.String getCollectBlockname() {
		return this.collectBlockname;
	}
	
	public void setCollectBlockname(java.lang.String value) {
		this.collectBlockname = value;
	}
	
	@Column(name = "collect_title", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public java.lang.String getCollectTitle() {
		return this.collectTitle;
	}
	
	public void setCollectTitle(java.lang.String value) {
		this.collectTitle = value;
	}
	
	@Column(name = "collect_title_reply_num", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getCollectTitleReplyNum() {
		return this.collectTitleReplyNum;
	}
	
	public void setCollectTitleReplyNum(java.lang.Integer value) {
		this.collectTitleReplyNum = value;
	}
	
	@Column(name = "collect_last_reply_userid", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getCollectLastReplyUserid() {
		return this.collectLastReplyUserid;
	}
	
	public void setCollectLastReplyUserid(java.lang.Integer value) {
		this.collectLastReplyUserid = value;
	}
	
	@Column(name = "collect_last_reply_username", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
	public java.lang.String getCollectLastReplyUsername() {
		return this.collectLastReplyUsername;
	}
	
	public void setCollectLastReplyUsername(java.lang.String value) {
		this.collectLastReplyUsername = value;
	}
	
	@Column(name = "collect_last_reply_time", unique = false, nullable = true, insertable = true, updatable = true, length = 20)
	public java.lang.String getCollectLastReplyTime() {
		return this.collectLastReplyTime;
	}
	
	public void setCollectLastReplyTime(java.lang.String value) {
		this.collectLastReplyTime = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("CollectId",getCollectId())
			.append("CollectTitleid",getCollectTitleid())
			.append("CollectUserid",getCollectUserid())
			.append("CollectBlockid",getCollectBlockid())
			.append("CollectBlockname",getCollectBlockname())
			.append("CollectTitle",getCollectTitle())
			.append("CollectTitleReplyNum",getCollectTitleReplyNum())
			.append("CollectLastReplyUserid",getCollectLastReplyUserid())
			.append("CollectLastReplyUsername",getCollectLastReplyUsername())
			.append("CollectLastReplyTime",getCollectLastReplyTime())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getCollectId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof BbsCollectInfo == false) return false;
		if(this == obj) return true;
		BbsCollectInfo other = (BbsCollectInfo)obj;
		return new EqualsBuilder()
			.append(getCollectId(),other.getCollectId())
			.isEquals();
	}
}

